<template>
     <PostItem v-for=" item in homePageData.homePostList" :key="item" :post = "item" />
     <pagination
      v-show="homePageData.total>0"
      :total="homePageData.total"
      :page="homePageData.pageNum"
      :limit="homePageData.pageSize"
      @pagination="paginationRecall"
    />
</template>

<script setup lang="ts">
import PostItem from '../../components/home/PostItem.vue';
import Pagination from "@/components/3rdPart/Pagination.vue";
import {homePageData} from '@/store/customer/inedx'

//曲线救国方法，这里有问待解决，无法直接通过Vue3的父子组件数据双向绑定实现
//只能双向绑定方法，所以这里套了一层回调方法
function paginationRecall(val:any){
  homePageData.getList(val.page,val.limit);
}

</script>

<style scoped>
.el-pagination{
    margin-top: 25px;
}
</style>